package vn.gq.tym.storytemplate;

import java.io.File;

import vn.gq.udv.utils.FileType;
import vn.gq.udv.utils.GQUtils;
import android.os.Environment;



public class GQConst {
	
	public static final String SEARCHURI_UNGDUNGVIET;
	public static final String SEARCHURI_TRUYENHAYVIET;
	public static final String DETAILURI;
	public static final String PACKAGENAME;
	public static final String SDCARDROOT;
	public static final String EMAIL;
	public static final String DS;
	public static final boolean SHOW_NEXT_PREV_BTN;
	public static final boolean FINISHED = true;
	public static final boolean TYPE_BOOK = false;
	public static final boolean SHOW_CATEGORY = true;
	public static final FileType FILE_TYPE = FileType.NORMAL;
	
	static {
		SEARCHURI_UNGDUNGVIET = "market://search?q=pub:\"UNG DUNG VIET\"";
		SEARCHURI_TRUYENHAYVIET = "market://search?q=pub:\"TRUYEN HAY VIET\"";
		DETAILURI = "market://details?id="+GQApplication.getContext().getPackageName();
		PACKAGENAME = GQApplication.getContext().getPackageName();
		SDCARDROOT = Environment.getExternalStorageDirectory().getAbsolutePath();
		EMAIL = "mailto:ungdungviet.llc@gmail.com?subject=Nhận xét, góp ý, yêu cầu truyện: \""+getString(R.string.app_name)+"\"";
		SHOW_NEXT_PREV_BTN = true;
		DS = File.separator;
	}
	
	private static String getString(int id) {
		String ret = "";
		ret = GQApplication.getContext().getString(id);
		return ret;
	}
	
	public static class DB {
		public static final String DATABASENAME;
		public static final int DBVERSION;
		public static final boolean PreferExternalStorage;
		public static final boolean ENCRYPTED = false;
		public static final String DATABASEPATH_SD;
		public static final String DATABASEPATH;
		public static final boolean TYPE_LOAD_ONLINE = true;
		
		static {
			DATABASENAME = "data";
			DBVERSION = 1;
			PreferExternalStorage = true;
			DATABASEPATH_SD = SDCARDROOT + DS + ".gqudv" + DS + GQUtils.md5(PACKAGENAME) + DS + GQUtils.md5(DATABASENAME);
			DATABASEPATH = "/data/data/" + PACKAGENAME + "/databases/" + DATABASENAME;
		}
	}
	
	public static class WebViewConfig {
		public static final boolean TEXT_JUSTIFY = true;
		public static final boolean LOAD_LOCAL_IMAGES = true;
	}
}

